package com.nwpu.coursesupport.controller;


import com.nwpu.coursesupport.entity.CourseTarget;
import com.nwpu.coursesupport.entity.EvaluationOfCourseTargetEntity;
import com.nwpu.coursesupport.entity.bean.Response;
import com.nwpu.coursesupport.service.imple.EvaluationOfCourseTargetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 *
 * @author shun
 * @email ws2017303035@mail.nwpu.edu.cn
 * @date 2020-08-04 21:33:50
 */
@RestController
public class EvaluationOfCourseTargetController {
    @Autowired
    private EvaluationOfCourseTargetService evaluationOfCourseTargetService;

    @RequestMapping("evaluation/{courseId}")
    public Response evaluationsByCourseId(@PathVariable("courseId") Integer courseId) {
        System.out.println("courseId:::"+courseId);

//        System.out.println("testtttt:"+courseTargetService.courseTargetsByCourseId(courseId));
        List<EvaluationOfCourseTargetEntity> evaluationOfCourseTargetEntities = evaluationOfCourseTargetService.evaluationsByCourseId(courseId);

        return Response.ok(evaluationOfCourseTargetEntities);
    }

}
